using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Grr.Web
{
    public class FormRewriterTextWriter : HtmlTextWriter
    {
        public FormRewriterTextWriter(HtmlTextWriter inner)
            : base(inner)
        {
        }

        public override void WriteAttribute(string name, string value, bool fEncode)
        {
            if (name == "action")
            {
                value = HttpContext.Current.Request.RawUrl;
            }
            base.WriteAttribute(name, value, fEncode);
        }
    }
}

